//
//  BeeMemberCell.m
//  FbeeAPP
//
//  Created by dev-m on 2018/3/25.
//  Copyright © 2018年 mohao. All rights reserved.
//

#import "BeeMemberCell.h"
#import "BeePhotoImageView.h"
#import "UserObj.h"


#define CellHeight 65

@interface BeeMemberCell()
{
    BeePhotoImageView *photo;
    UILabel *nickNameL;
    UILabel *dateL;
}

@end

@implementation BeeMemberCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    
    if (self) {
        
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        self.backgroundColor = FBEE_COLOR_BACKGROUND;
        
        [self buildView];
    }
    
    return self;
    
}

-(void)buildView
{
    photo = [[BeePhotoImageView alloc] initWithFrame:CGRectMake(15, (CellHeight - 35)/2, 35, 35) photoStyle:BeePhotoCellStyle];
    [self addSubview:photo];
    
    nickNameL = [UILabel makeLabel:^(TTLabelExtend *make) {
        make.addFont([UIFont systemFontOfSize:16.0f]).addTextColor(FBEE_COLOR_TEXT);
        make.setFrame(CGRectMake(photo.right + 12, photo.top, 250, 17));
        [self addSubview:make];
    }];
    
    dateL = [UILabel makeLabel:^(TTLabelExtend *make) {
        make.addFont([UIFont systemFontOfSize:12.0f]).addTextColor(FBEE_COLOR_INFO);
        make.setFrame(CGRectMake(photo.right + 10, nickNameL.bottom + 5, 200, 13));
        [self addSubview:make];
    }];

}

-(void)setUserObj:(UserObj *)userObj
{
    [photo setTitle:userObj.nickName];
    
    nickNameL.text = userObj.nickName;
    
    dateL.text = userObj.updateTime;
    
    
    _userObj = userObj;
}


@end
